#ifndef	__LIBKYLIN_ACTIVTION_TYPE_H___
#define	__LIBKYLIN_ACTIVTION_TYPE_H___

typedef   unsigned short  WORD;
typedef   unsigned short  USHORT;
typedef   unsigned int    DWORD;
typedef   unsigned char   BYTE;
typedef   int             INT;
typedef   unsigned int    UINT;
typedef   unsigned short  WCHAR;
typedef   unsigned char*  LPSTR;

#define LICENSE_GROUP "license"
#define SPACE_ALIGNMENT 1000

#define ENCRYPTED_NUMBER_LENGTH 20

typedef char* (*encrypted_number_generator)(const char*, const char*, const char*);

/*
 * _same_ukey_hid, check if the hid in vikey and kyinfo file are the same
 * return 1 if yes, or 0 if not
 */
static inline int _same_ukey_hid(const char* ukey_hid, const char* kyinfo_ukey)
{
	if(!ukey_hid || !kyinfo_ukey)
		return 0;

	return (0 == strcmp(ukey_hid, kyinfo_ukey));
}

/*
 * _same_expire_date_tm, check if the expire dates in struct tm are the same
 * return 1 if yes, or 0 if not
 */
static inline int _same_expire_date_tm(struct tm* ukey_expire_tm, struct tm* expire_date_tm)
{
	if(!ukey_expire_tm || !expire_date_tm)
		return 0;

	return ((ukey_expire_tm->tm_year == expire_date_tm->tm_year) &&
	        (ukey_expire_tm->tm_mon  == expire_date_tm->tm_mon ) &&
	        (ukey_expire_tm->tm_mday == expire_date_tm->tm_mday));
}


#endif
